#ifndef LICENCE_H
#define LICENCE_H

#include <QList>
#include <QObject>
#include <QFile>
#include <QTextCodec>
#include <QMessageBox>
#include <QPushButton>
#include <QDebug>
#include <QFileDialog>

#ifdef _TTY_POSIX_
#include "sys/stat.h"
#endif

//extern "C"{
#include "DES.h"
//}

extern QString g_installPath;

typedef QList<QString> DEVICEIDLIST;

typedef struct
{
    char licence[64];
}LICENCE;

class licence
{
public:
    licence();

    bool getLicence(QString& devID, LICENCE& licence);

    bool decryptLicence(char* license, char* devID);

    bool checkLicence(QString &msg);
    bool  get_mac(DEVICEIDLIST& macLIst);

private:
    bool  getDeviceInfo(DEVICEIDLIST& devIDList);
    bool  idToLicence(QString& devID, LICENCE& licence);
    bool  licenceToId(char* license, char* devID);

};

#endif // LICENCE_H
